package fido;

import javax.swing.*;

public class Main {
    public static void main(String[] args) {
        UserInterface ui;
        //check if there are arguments, then run tui..
        if (args.length <= 0) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                //do nothing;
            }
            try {
                ui = new GuiController();
            } catch (Exception e) {
                //handling HeadLessException, and any other exception...
                ui = new TuiController();
            }


        } else {
            ui = new TuiController();
        }
        Fido fido = Fido.instance();
        fido.setUserInterface(ui);
        ui.setFido(fido);
        ui.startUserInterface(args);

    }
}
